#ifndef CONTACTITEM_H
#define CONTACTITEM_H

#include <QIcon>
#include <QObject>

class ContactItemData
{
public:
    QString networkId;
    QString id;

    int presence;
    QString presenceText;
    QString name;
};

class ContactInfo : public QObject
{
    Q_OBJECT
public:
    enum Presence {Offline, Online, Away /* Bisy */};

    ContactInfo& operator =(const ContactInfo &other);
    ContactInfo(const ContactInfo &other);
    explicit ContactInfo(const QString &id = QString(), const QString &networkId = QString(), QObject *parent = 0);

    bool isValid() const;

    QString networkId() const;
    void setNetworkId(const QString &networkId);

    QString id() const;
    void setId(const QString &id);

    QString name() const;
    void setName(const QString &name);

    Presence presence() const;
    void setPresence(Presence presence);

    QString presenceText() const;
    void setPresenceText(const QString &text);

    QIcon picture() const;

signals:
    void changed(ContactInfo * contact);

private:
    ContactItemData d;

    static void copyContactInfo(ContactInfo * first, const ContactInfo * second);
};

#endif // CONTACTITEM_H
